//
//  BSUIDeviceResponseList+BSUIDeviceResponseList_category.m
//  SuoSiApp
//
//  Created by zhang on 16/5/18.
//  Copyright © 2016年 Ym. All rights reserved.
//

#import "BSUIDeviceResponseList+BSUIDeviceResponseList_category.h"

@implementation BSUIDeviceResponseList (BSUIDeviceResponseList_category)
- (void)dealWithData:(NSData *)data{
    
    NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:(NSJSONReadingMutableContainers) error:nil];
    //    根据收到的data  给自己的属性 赋值
    NSLog(@"%@",dic);

    //    NSArray *arr = [NSArray arrayWithArray:dic[@"Data"]];
    if ([dic[@"Code"] isEqualToString:@"0"]) {
//        NSDictionary *dic1 = [NSDictionary dictionaryWithDictionary:dic[@"Data"]];
        
        [self setValuesForKeysWithDictionary:dic];
        
        NSArray *arr  = [NSArray arrayWithArray:dic[@"Data"]];
        if (arr.count > 0) {
            NSDictionary *dict = [NSDictionary dictionaryWithDictionary:arr[0]];
            self.DeviceModel = [[BSUIDevice alloc]init];
            [self.DeviceModel setValuesForKeysWithDictionary:dict];
//            NSLog(@"%@",self.DeviceModel.UUID);

#pragma mark  或者登录人员绑定的设备
            [BSUserSGton userHandle].DeviceID = self.DeviceModel.DeviceID;

        }
        
        
          } else {
        [PKRequestManager showAlertView:dic[@"Message"]];
    }
}

- (void)dealNoNoteWithData:(NSData *)data{
    
    NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:(NSJSONReadingMutableContainers) error:nil];
    //    根据收到的data  给自己的属性 赋值
    NSLog(@"%@",dic);
    //    NSArray *arr = [NSArray arrayWithArray:dic[@"Data"]];
    if ([dic[@"Code"] isEqualToString:@"0"]) {
        //        NSDictionary *dic1 = [NSDictionary dictionaryWithDictionary:dic[@"Data"]];
        
        [self setValuesForKeysWithDictionary:dic];
        
        NSArray *arr  = [NSArray arrayWithArray:dic[@"Data"]];
        NSDictionary *dict = [NSDictionary dictionaryWithDictionary:arr[0]];
        self.DeviceModel = [[BSUIDevice alloc]init];
        [self.DeviceModel setValuesForKeysWithDictionary:dict];
        NSLog(@"%@",self.DeviceModel.UUID);
    } else {
        [PKRequestManager showAlertView:dic[@"Message"]];
    }
}



- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
    
    
    
}
@end
